import unittest
import os

from hames.discovery import TestDiscovery

APPID_KEY = 'APPLICATION_ID'

class RootDirectoryTestCase(unittest.TestCase):

    def setUp(self):
        super(RootDirectoryTestCase, self).setUp()
        self.old_appid = os.getenv(APPID_KEY)

    def tearDown(self):
        super(RootDirectoryTestCase, self).tearDown()
        if self.old_appid:
            os.environ[APPID_KEY] = self.old_appid
        else:
            os.environ.pop(APPID_KEY)

    # def test_root_directory_removed_from_cwd(self):
    #     # /base/data/home/apps/s~[appid]/[version].357469062815359110/app/domain/mondasta/api/charts
    #     expected_rootdir = '/some/deep/path/'
    #     appid = 'my-app'
    #     os.environ[APPID_KEY] = appid
    #     cwd = expected_rootdir + appid + '.version-0124ghufbg2/lib/hames/'
    #     td = TestDiscovery()
    #     rootdir = td.get_root_application_directory(cwd, appid)
    #     self.assertEquals(expected_rootdir, rootdir)
